package de.tabuma.sso.useruserrelation;

import de.tabuma.sso.logik.*;
import java.util.*;

/**
 * @author $Author: alefen $
 * @version $Revision: 1.1.1.1.2.1 $
 * @since $Date: 2010/01/08 10:03:24 $
 */
public class UserUserRelationFacade {

    public static int create(UserUserRelation usergroup, String user) {
        return (int) PMF.doCreate(usergroup, user);
    }

    public static UserUserRelation get(int id) {
        return PMF.get(id, new UserUserRelation());
    }

    public static void remove(int id, String user) {
        UserUserRelation usergroup = get(id);
        PMF.doRemove(usergroup, user);
    }

    public static List<UserUserRelation> getList(int userId) {
        String keys[] = new String[1];
        keys[0] = "userId";
        String values[] = new String[1];
        values[0] = "" + userId;
        return PMF.get(keys, values, new UserUserRelation());
    }

    public static List<UserUserRelation> getList1(String user) {
        String keys[] = new String[1];
        keys[0] = "user";
        String values[] = new String[1];
        values[0] = "" + user;
        return PMF.get(keys, values, new UserUserRelation());
    }

}